
package ext.opensource.netty.server.example.mqtt.redis.config;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.env.Environment;
import org.springframework.core.type.AnnotatedTypeMetadata;

public class RedisConditionalCache implements Condition {
	@Override
	public boolean matches(final ConditionContext context, final AnnotatedTypeMetadata metadata) {
		final Environment env = context.getEnvironment();
		return "redis".equalsIgnoreCase(env.getProperty("netty.server.cache"));
	}
}
